;info "by Dominic Mazzoni, modified by David R. Sky\nReleased under terms of the GNU General Public License version 2\nFor help, select one of two help screens in 'Action choice' below."
;control action "Action choice" choice "Generate track, help screen 1, help screen 2" 0
;control tempo "Tempo [beats per minute]" int "30 - 300 beats/minute" 120 30 300
;control sig "Beats per measure [bar]" int "1 - 20 beats/measure" 4 1 20
;control measures "Number of measures [bars]" int "1 - 1000 bars" 16 1 1000
;control high "MIDI pitch of strong click" int "18 - 116" 92 18 116
;control low "MIDI pitch of weak click" int "18 - 116" 80 18 116
; original clicktrack.ny by Dominic Mazzoni,
; modified by David R. Sky:
; string input verification added by Steve Daulton, 2009.
; added click pitch [user request] and sound types fields September 2007
; added optional total click track duration field [requested by Mike Mullins]
; June 2009
; added individual click duration field [requested by Quinto Milana]
; June 2009]
; original code kept 'as is'.
; now includes:
; choice between click sounds [ping {sinewave}, noise or tick],
; user-set MIDI pitch values for strong and weak clicks,
; resonance of noise clicks
; [higher resonance gives them more discernable pitch],
; time offset for start of click track,
; and error-checking code to generate error message
; for such things as negative value inputs
; Drip sound generator by Paul Beach,
; used with permission.
;
; Thanks very much to Gale Andrews, who gave extensive visual feedback
; and suggestions!
; view 1 of 2 help screens, or generate click track
(cond ; 'master' cond
((= action 1) ; display help screen 1
(format nil
"Click Track Generator help - screen 1 of 2
Generates a click track at the selected tempo, beats per\nmeasure, and either number of measures or track duration,\nusing selected click sound.
'Tempo': number of beats (clicks) per minute.
'Beats per measure (bar)': For example, 3/4 time means one\nstrong click then two others to form one bar, repeated\ndepending on 'number of measures' or 'click track duration'.
'Optional click track duration': If you enter a value into this\nfield, either [minutes seconds] (separated by a space), or\n[seconds], the generated click track will be at or slightly\nlonger than this duration: the end of the track is extended\ninto a whole measure if the entered duration does not\nproduce this. Use whole numbers only.
If you enter a value into this field, the 'number of measures'\nvalue will be ignored.
To generate click track or view help screen 2,\n restart Click Track and select from 'Action choice'.") ; end format
) ; end display help screen 1
((= action 2) ; display help screen 2
(format nil
"Click Track Generator help - screen 2 of 2
'Individual click duration': the duration of each individual\nclick, minimum of 1 millisecond (ms) to maximum of 100 ms.
'Start time offset': makes the click track start at a later\ntime than the very beginning (zero seconds), maximum\nof 30 seconds.
'Click sound': choose between ping, noise or tick sound\nfor clicks.
'Noise click resonance': the higher this value, the more\nclearly noise clicks have a tone.
'MIDI pitch of strong/weak click': MIDI values indicate\nwhat pitch to use. C-notes are:
24, 36, 48, 60 (middle C), 72, 84, 96, 108.\nC# (C-sharp) above middle C is 61.
To generate click track or view help screen 1,\n restart Click Track and select from 'Action choice'.") ; end format
) ; end display help screen 2
(t ; perform clicktrack.ny
(setf click-type (+ click-type 1))
; check function: returns 1 on error
; min and max are allowable min and max values for arg